package com.sxpi.order.feign.api;

import com.sxpi.common.result.R;
import com.sxpi.order.vo.OrderVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @Author: 董伟豪
 * @Date: 2022/10/2 17:32
 * 定义Feign的接口
 */
@FeignClient(name = "sxpi-service-order")
public interface OrderApiFeign {

    /**
     * 下单方法
     * @param orderDto
     * @return
     */
    @PostMapping("/order/create")
    R saveOrder(@RequestBody OrderVo orderDto);

    /**
     * 查询订单信息
     * @param orderNo
     * @return
     */
    @PostMapping("/order/info/{orderNo}")
    R getOrderInfoByOrderNo(@PathVariable("orderNo") String orderNo);
}
